package com.siqi.hr.system.common.chan;

import com.siqi.hr.system.common.sql.SField;
import com.siqi.hr.system.common.sql.STable;
import com.siqi.hr.system.common.utils.CollectionUtils;

import java.util.Collection;
import java.util.LinkedList;


public class FieldChan extends LinkedList<SField> implements SqlChan {
	private static final long serialVersionUID = -2287951680167570012L;

	public StringBuilder toSqlString() {
		return CollectionUtils.join(this);
	}

	public Integer getFieldIndex(SField field) {
		return CollectionUtils.getElementIndex(this, field);
	}

	public FieldChan(Collection<SField> f) {
		addAll(f);
	}

	public FieldChan() {
	}

	public static void main(String[] args) {
		SField sf = new SField("name", new STable("pk_t_5_1"));
		System.out.println(sf.toSqlString());
	}
}
